package Model

import "time"

type Paycheck struct {
	itsGrossPay float64
	itsNetPay float64
	itsDeductions float64
	itsPayPeriodStartDate time.Time
	itsPayPeriodEndDate time.Time
	itsFields map[string]string
}

//返回一个value值，
func (p *Paycheck) ItsFields(name string) string {
	return p.itsFields[name]
}
//传入一个name值和一个value值
func (p *Paycheck) SetFields(name string, value string) {
	p.itsFields[name] = value
}

func (p *Paycheck) GetPayPeriodEndDate() time.Time {
	return p.itsPayPeriodEndDate
}

func (p *Paycheck) GetPayPeriodStartDate() time.Time {
	return p.itsPayPeriodStartDate
}

func (p *Paycheck) GetDeductions() float64 {
	return p.itsDeductions
}

func (p *Paycheck) SetDeductions(itsDeductions float64) {
	p.itsDeductions = itsDeductions
}

func (p *Paycheck) GetNetPay() float64 {
	return p.itsNetPay
}

func (p *Paycheck) SetNetPay(itsNetPay float64) {
	p.itsNetPay = itsNetPay
}

func (p *Paycheck) GetGrossPay() float64 {
	return p.itsGrossPay
}

func (p *Paycheck) SetGrossPay(itsGrossPay float64) {
	p.itsGrossPay = itsGrossPay
}

func NewPaycheck(payPeriodStart time.Time, payPeriodEnd time.Time) Paycheck {
	return Paycheck{
		itsPayPeriodStartDate: payPeriodStart,
		itsPayPeriodEndDate: payPeriodEnd,
	}
}


